
food = 'apple pie'
print("01:",food[0:5])
print("02:",food[6:9])
print("03:",food[:5])
print("04:",food[6:])
print("05:",food[-9:-4])
print("06:",food[:-4])
print("07:",food[-3:0])
print("08:",food[-3:])
print("09:",food[::2])  # 从第1个字符开始，以2为步长截取字符
print("10:",food[1::2])  # 从第2个字符开始，以2为步长截取字符
print("11:",food[::-1])  # 将整个字符串逆序排列
